 package com.sasis.service.impl;

import java.util.List;

import com.sasis.dao.UserInfoDAO;
import com.sasis.model.UserInfo;
import com.sasis.service.UserInfoService;
import com.sasis.util.PageList;
import com.sasis.util.PageRequest;

public class UserInfoServiceImpl extends BaseManager implements UserInfoService{
	private UserInfoDAO userInfoDao;
	
	
	public UserInfoDAO getUserInfoDao() {
		return userInfoDao;
	}

	public void setUserInfoDao(UserInfoDAO userInfoDao) {
		this.userInfoDao = userInfoDao;
	}

	public int delete(UserInfo userInfo) {
		return userInfoDao.deleteByPrimaryKey(userInfo);
	}

	public List getAllUsers(UserInfo userInfo ) { 
		return userInfoDao.select(userInfo);
	}

	public UserInfo getUserInfo(String userId, String password) {
		
		return userInfoDao.getUserInfo(userId, password);
		 
	}

	public UserInfo getUserInfoByID(int depId) {
		// TODO Auto-generated method stub
		return null;
	}

	public List getUsersByDepID(int depId) {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean insert(UserInfo userInfo) { 
		return userInfoDao.insert(userInfo);
	}

	public int update(UserInfo userInfo) {
		 
		return userInfoDao.updateByPrimaryKey(userInfo);
	}

	public List getRightAll() {  
		return userInfoDao.getRightAll();
	}

	public List getRoleAll() {
		// TODO Auto-generated method stub
		return userInfoDao.getRoleAll();
	}

	public int updateUserRightRefByPK(UserInfo record) {
		// TODO Auto-generated method stub
		return userInfoDao.updateUserRightRefByPK(record);
	}

	public int updateUserRoleRefByPK(UserInfo record) {
		// TODO Auto-generated method stub
		return userInfoDao.updateUserRoleRefByPK(record);
	}

	public List getUserRightRefByPK(String seledId) {
		// TODO Auto-generated method stub
		return userInfoDao.getUserRightRefByPK( seledId);
	}

	public List getUserRoleRefByPK(String seledId) {
		// TODO Auto-generated method stub
		return userInfoDao.getUserRoleRefByPK( seledId);
	}
	
	public int deleteUserRightRefByPK(UserInfo record){
		return userInfoDao.deleteUserRightRefByPK(record);
	}
	public int deleteUserRoleRefByPK(UserInfo record){
		return userInfoDao.deleteUserRoleRefByPK(record);
	}
	
	//get top leader by user id
	public List getTopLeaderByUserId(UserInfo record){
		return userInfoDao.getTopLeaderByUserId(record);
	}
	
	public PageList queryForPageList(String listStatementId,  
    		Object parameterObject, PageRequest pageRequest){
	return userInfoDao.queryForPageList(listStatementId,   parameterObject, pageRequest);
}
	public UserInfo getUserInfoByPK(String id){
		return userInfoDao.getUserInfoByPK(id);
	}
}
